from carryCube import CarryCube
from vec3 import Vec3

class Shrapnel(CarryCube):
    
    def __init__(self, player, bomb, pos, vel):
        CarryCube.__init__(self)
        
        self.setVar("timedCollect", True)
        self.setVar("collectTime", 1.5)
        self.setVar("collectBlinkTime", -1)
        
        self.setVar("texture", "clusterBomb")
        self.setVar("scale", Vec3(.25, .25, .25))
        self.setVar("vulnerable", True)
        self.setVar("elasticity", 0.7)
       
        self.player = player
        self.bomb   = bomb
        self.setVar("pos", pos)
        self.setVar("vel", vel)
        
    def itemCollision(self, player):
        if(not(self.player == player.getVar("player"))):
            fromPlayer = self.player
            toPlayer   = player.getVar("player")
            self.bomb.report(fromPlayer, toPlayer)
